﻿using System.Text;

namespace Viyi.Util
{
    public sealed class Settings
    {
        public static Settings Global
        {
            get { return global ?? (global = new Settings()); }
            set { global = value; }
        }

        private static Settings global;

        private Encoding byteArrayEncoding;

        public bool IsLittleEndian { get; set; }

        public Encoding ByteArrayEncoding
        {
            get { return byteArrayEncoding ?? (byteArrayEncoding = Default.ByteArrayEncoding); }
            set { byteArrayEncoding = value; }
        }

        private static class Default
        {
            public const bool IsLittleEndian = false;
            public static readonly Encoding ByteArrayEncoding = Encoding.Default;
        }
    }
}
